package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.domain.entity.TJszHistoryData;
import com.ruoyi.common.core.domain.entity.TObstacle;
import com.ruoyi.common.core.domain.entity.TReceiveStation;
import com.ruoyi.system.mapper.JszHistoryDataMapper;
import com.ruoyi.system.mapper.ReceiveStationModeMapper;
import com.ruoyi.system.service.IReceiveStationModeService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * @Auther: Stanley.Y
 * @Date: 2024/6/18
 * @Description:
 * @Version 1.0.0
 */
@Service
public class ReceiveStationModeServiceImpl implements IReceiveStationModeService {
    private static final Logger log = LoggerFactory.getLogger(ReceiveStationModeServiceImpl.class);

    @Autowired
    private ReceiveStationModeMapper receiveStationModeMapper;

    @Autowired
    private JszHistoryDataMapper jszHistoryDataMapper;

    @Override
    public List<TReceiveStation> getReceiveStationInfoList() {
        List<TReceiveStation> result = receiveStationModeMapper.getReceiveStationInfoList();
        return result;
    }

    @Override
    public List<TObstacle> getObstacleInfoList() {
        return receiveStationModeMapper.getObstacleInfoList();
    }

    /**
     * 查询接收站信息
     *
     * @param id 接收站ID
     * @return 接收站信息
     */
    @Override
    public TReceiveStation selectReceiveStationById(String id) {
        return receiveStationModeMapper.selectReceiveStationById(id);
    }

    /**
     * 查询接收站列表
     *
     * @param receiveStation 接收站信息
     * @return 接收站集合
     */
    @Override
    public List<TReceiveStation> selectReceiveStationList(TReceiveStation receiveStation) {
        return receiveStationModeMapper.selectReceiveStationList(receiveStation);
    }

    /**
     * 新增接收站数据
     *
     * @param receiveStation 接收站信息
     * @return 结果
     */
    @Override
    public int insertReceiveStation(TReceiveStation receiveStation) {
        return receiveStationModeMapper.insertReceiveStation(receiveStation);
    }

    /**
     * 修改接收站数据
     *
     * @param receiveStation 接收站信息
     * @return 结果
     */
    @Override
    public int updateReceiveStation(TReceiveStation receiveStation) {
        return receiveStationModeMapper.updateReceiveStation(receiveStation);
    }

    /**
     * 删除接收站信息对象
     *
     * @param id 接收站信息id
     * @return 结果
     */
    @Override
    public int deleteReceiveStationById(String id) {
        return receiveStationModeMapper.deleteReceiveStationById(id);
    }

    /**
     * 批量删除接收站信息
     *
     * @param ids 需要删除的接收站数据id
     * @return 结果
     */
    @Override
    public int deleteReceiveStationByIds(String[] ids) {
        return receiveStationModeMapper.deleteReceiveStationByIds(ids);
    }

    /**
     * 保存接收站分析数据
     * @param tJszHistoryData
     * @return
     */
    @Override
    public int saveJszAnalyseData(TJszHistoryData tJszHistoryData) {
        return jszHistoryDataMapper.saveJszAnalyseData(tJszHistoryData);
    }

    /**
     * 查询理解接收站
     * @return
     */
    @Override
    public List<TJszHistoryData> queryJszLastRecordList(int maxCount) {
        return jszHistoryDataMapper.queryJszLastRecordList(maxCount);
    }

    /**
     * 根据ID查询接收站模式下的历史分析过程数据
     * @param id
     * @return
     */
    @Override
    public TJszHistoryData getJszRecordById(int id){
        return jszHistoryDataMapper.getJszRecordById(id);
    }
}
